#include "commonheader.h"
#include "config.h"
#include "sdhlp/strhelper.h"
#include "sdutility.h"

#include <string>

IMPLEMENT_SINGLETON(CConfig)
CConfig::CConfig()
{

}

CConfig::~CConfig()
{

}

bool CConfig::LoadConfig(const char * lpInitFile)
{

	return true;
}


int CConfig::GetDBConnInfo(SDBConnInfo** ppstInfo)
{
    return 0;
    char szPath[MAX_PATH];
    sprintf(szPath, "%s/%s", GetExePath(), "config.ini");

    (*ppstInfo)[0].m_nSN = 1;
    ::GetPrivateProfileString("Config", "dbip",  "127.0.0.1",  (*ppstInfo)[0].m_stAccount.m_szHostName, SDDB_MAX_NAME_SIZE, szPath);
     (*ppstInfo)[0].m_stAccount.m_wConnPort =::GetPrivateProfileInt("Config", "dbport",  3306, szPath);
    ::GetPrivateProfileString("Config", "loginname",  "root",  (*ppstInfo)[0].m_stAccount.m_szLoginName, SDDB_MAX_NAME_SIZE, szPath);
    ::GetPrivateProfileString("Config", "loginpwd",  "000000", (*ppstInfo)[0].m_stAccount.m_szLoginPwd, SDDB_MAX_NAME_SIZE, szPath);
    ::GetPrivateProfileString("Config", "dbname",  "worldzero", (*ppstInfo)[0].m_stAccount.m_szDBName, SDDB_MAX_NAME_SIZE, szPath);
    ::GetPrivateProfileString("Config", "charactset",  "latin1", (*ppstInfo)[0].m_stAccount.m_szCharactSet, SDDB_MAX_CHARACTSET_SIZE, szPath);

    return 1;
}
